package com.infore.exchange.main.service.impl;

import com.infore.common.model.entity.exchange.TTaskInfo;
import com.infore.exchange.main.dao.TTaskInfoMapper;
import com.infore.exchange.main.service.TTaskInfoService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 任务信息表 服务实现类
 * </p>
 *
 * @author lijh
 * @since 2023-02-13
 */
@Service
public class TTaskInfoServiceImpl extends ServiceImpl<TTaskInfoMapper, TTaskInfo> implements TTaskInfoService {


    @Autowired
    private TTaskInfoMapper taskInfoMapper;

    @Override
    public boolean updateTaskStateById(String taskId, Integer status) {
        taskInfoMapper.updateTaskStateById(taskId,status);
        return true;
    }
    @Override
    public boolean updateTaskRunningStateById(String taskId, Integer runningState) {
        taskInfoMapper.updateTaskRunningStateById(taskId,runningState);
        return true;
    }

    @Override
    public boolean resetAllTaskRunningState() {
        taskInfoMapper.resetAllTaskRunningState();
        return true;
    }


    /**
    * @Deacription 未被绑定的任务
    * @MethodName notBindTask
    * @param
    * @return {@link List< TTaskInfo>}
    * @Author lijianhua
    * @Date 2023/2/24 10:02
    **/
    @Override
    public List<TTaskInfo> notBindTask() {
        return taskInfoMapper.notBindTask();
    }

}
